package com.bjdd.jdy.view.widget;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;

import com.bjdd.jdy.ui.previewImg.PreviewImgActivity;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by Administrator on 2017/7/3.
 */

public class ZoomImage {
    public static final int URL_MODE = 0;
    public static final int LOCAL_MODE = 1;
    public static interface Listener{
        void del(int position);
    }
    public static class Builder {
        Context mContext;
        private int mode;
        private int index;
        private String eventName;
        private ArrayList data;
        public Builder(Context context){
            this.mContext = context;
        }
        public Builder setMode(int mode){
            this.mode = mode;
            return this;
        }
        public Builder setIndex(int index){
            this.index = index;
            return this;
        }
        public Builder setData(List<String> paths){
            this.data = new ArrayList();
            data.add(paths);
            return this;
        }
        public Builder setEventName(String targetStr){
            this.eventName = targetStr;
            return this;
        }
        public void show(){
            Intent intent = new Intent(mContext, PreviewImgActivity.class);
            Bundle bundle = new Bundle();
            bundle.putInt("mode",mode);
            bundle.putInt("index",index);
            bundle.putString("eventName",eventName);
            bundle.putParcelableArrayList("data",data);
            intent.putExtras(bundle);
            mContext.startActivity(intent);
        }
    }
}
